<?php
/**
* @version		1.1
* @package		Taxi Booking
* @copyright	Copyright (C) 2011 KANEV.CO.UK All rights reserved.
* @license		GNU/GPL, see license.txt
* Taxi Booking is open source software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
*This program is distributed in the hope that it will be useful,
*but WITHOUT ANY WARRANTY; without even the implied warranty of
*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*GNU General Public License for more details.
*You should have received a copy of the GNU General Public License
*along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
defined( '_JEXEC' ) or die( 'Restricted access' );

//include the needed classes
require_once (JPATH_COMPONENT.DS.'classes'.DS.'booking.helper.php');

//Set filepath
$params =& JComponentHelper::getParams('com_taxibooking');
define('COM_TAXIBOOKING_FILEPATH',    JPATH_ROOT.DS.$params->get($path, 'components/com_taxibooking/upload'));
//echo $path;
// Set the table directory
JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.DS.'tables');

// Require the controller
require_once (JPATH_COMPONENT.DS.'controller.php');

// Require specific controller if requested
if( $controller = JRequest::getWord('controller') ) {
	$path = JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php';
	if (file_exists($path)) {
		require_once $path;
	} else {
		$controller = '';
	}
}

// Create the controller
$classname  = 'TaxiBookingController'.$controller;
$controller = new $classname( );

// Perform the Request task
$controller->execute( JRequest::getVar('task', null, 'default', 'cmd') );

// Redirect if set by the controller
$controller->redirect();
?>